import UIKit
import SwiftyJSON
import Foundation

//var optionalName: String? = "John Appleseed"
var optionalName: String?
var greeting = "Hello!"
if let name = optionalName {
    greeting = "Hello, \(name)"
}
print(greeting)
//

let jsonStr = "[{\"name\": \"hangge\", \"age\": 100, \"phones\": [{\"name\": \"公司\",\"number\": \"123456\"}, {\"name\": \"家庭\",\"number\": \"001\"}]}, {\"name\": \"big boss\",\"age\": 1,\"phones\": [{ \"name\": \"公司\",\"number\": \"111111\"}]}]"
//print(jsonStr)
 let data = jsonStr.data(using: .utf8)
//    let json = JSON(data)
//print(data)
//print(jsonos

//if let firstName = json[0]["name"].string {
//    print("第一个联系人的姓名: \(firstName)")
//}
//if let firstAge = json[0]["age"].intValue {
//    print("第一个联系人的年龄: \(firstAge)")
//}
//if let name = json["name"].string {
//    print(name)
//}
